<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>织蝶云 - OA+PM+CRM一站式企业应用管理平台</title>
    <!-- 小图标 -->
    <link rel="shortcut icon" href="./images/favicon/favicon.ico" type="image/x-icon">
    <!-- 清除样式 -->
    <link rel="stylesheet" href="./css/resets.css">
    <!-- bootstrap的css包 -->
    <link rel="stylesheet" href="./lib/bootstrap_4/css/bootstrap.min.css">
    <!-- 模板样式css -->
    <link rel="stylesheet" href="./css/lyj_knowledge.css">
    <link rel="stylesheet" href="./css/lyj_knowledge_add.css">
    <!-- 清除样式 -->
    <link rel="stylesheet" href="./css/resets.css">
    <!-- 引入字体图标css -->
    <link rel="stylesheet" href="./css/iconfont/lyj_iconfont/iconfont.css">
    <link rel="stylesheet" href="./css/iconfont/lyd_approval/iconfont.css">
</head>

<body>
    <div class="left_nav">
        <div class="logo">
            <a href="/tmeplate">
                <img src="./images/lyd/lyd_approval_frame_logo-left.png" alt="织蝶云">
            </a>
        </div>
        <div class="left_nav_menu">
                <ul class="left_nav_menu_nav">
                        <li class="btn-block">
                            <a href="/page">
                                <i class="iconfont icon-home"></i>
                                <span>主页</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/mange">
                                <i class="iconfont icon-list"></i>
                                <span>项目</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/lyd_approval">
                                <i class="iconfont icon-suitcase"></i>
                                <span>审批</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/gy-CRM">
                                <i class="iconfont icon-users"></i>
                                <span>CRM</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-calendar"></i>
                                <span>日程</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-tasks"></i>
                                <span>报告</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-book"></i>
                                <span>知识</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/document">
                                <i class="iconfont icon-columns"></i>
                                <span>文档</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/resume">
                                <i class="iconfont icon-male"></i>
                                <span>简历</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-tupian"></i>
                                <span>相册</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-bull-horn-announcer"></i>
                                <span>公告</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="javascript:;">
                                <i class="iconfont icon-gavel"></i>
                                <span>考勤</span>
                            </a>
                        </li>
                        <li class="btn-block">
                            <a href="/yyl_system">
                                <i class="iconfont icon-cogs"></i>
                                <span>系统</span>
                            </a>
                        </li>
                    </ul>
        </div>
    </div>
    <div class="top_nav_box">
        <div class="top_nav">
            <a class="toggle-btn">
                <i class="iconfont icon-bars"></i>
            </a>
            <div class="top_center">
                <a href="/lyj_knowledge" class="btn btn-all actives">我的知识</a>
                <a href="/lyj_knowledge_show" class="btn btn-all">全部知识</a>
                <a href="/lyj_knowledge_set" class="btn btn-all">分类设置</a>
            </div>
            <div class="top_right">
                <ul class="top_right_info">
                    <li>
                        <a href="javascript:;" class="btn info_icon">
                            <i class="iconfont icon-envelope-o"></i>
                        </a>
                        <div class="nav_switch_off">
                            <h5>你有0条信息</h5>
                            <ul>
                                <li>目前还没有最新消息</li>
                                <li>
                                    <a href="javascript:;">查看更多</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <a href="javascript:;">
                            <!-- <img src="./images/lyd/6.jpg" alt="管理员"> -->
                        </a>
                        <ul class="nav_switch_off">
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>个人主页</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>基本资料</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>更换头像</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>更换密码</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>我的任务</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>升级为付费版</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>订单</a></li>
                            <li><a href="javascript:;"><i class="iconfont icon-xx"></i>聊天</a></li>
                            <li><a href="/outlogin"><i class="iconfont icon-SignOut"></i>退出</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div class="content-box">
            <div class="content">
                <!-- 顶部搜索 -->
                <div class="top_search">
                    <!-- 添加知识 -->
                    <div class="top_add_knowledge_left">
                        <h1>
                            <i class="iconfont icon-arrow-circle-o-down"></i>
                            添加知识
                        </h1>
                    </div>
                    <div class="top_add_knowledge_rigth">
                        <a href="/lyj_knowledge">
                            <i class="iconfont icon-chevronleft"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 中间内容 -->
                <div class="middle_2 clearfix">
                    <div class="middle_content clearfix">
                        <div class="middle_table clearfix">
                            <section>
                                <form action="" class="middle_table_form">
                                    <!-- 类别 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            <span>*</span>
                                            类别
                                        </label>
                                        <div class="middle_form_text">
                                            <select name="name" id="sel" class="form_text label">
                                                <option><%= name%></option>
                                                <option>请选择分类</option>
                                                <option>市场营销</option>
                                                <option>运营</option>
                                                <option>随笔</option>
                                            </select>
                                        </div>
                                    </div>
                                    <!-- 标题 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            <span>*</span>
                                            标题
                                        </label>
                                        <div class="middle_form_text">
                                            <input type="text" name="title" id="" placeholder="请填写标题" class="form_text title"
                                                value="<%= title%>">
                                        </div>
                                    </div>
                                    <!-- 标签 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            标签
                                        </label>
                                        <div class="middle_form_text">
                                            <input type="text" name="tag" placeholder="请填写标签" class="form_text tag"
                                            value="<%= label%>">
                                        </div>
                                    </div>
                                    <!-- URL -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            URL
                                        </label>
                                        <div class="middle_form_text">
                                            <input type="url" name="url" id="" placeholder="http://"
                                                title="请输入URL地址，http://、https://" class="form_text url" value="<%= url%>">
                                        </div>
                                    </div>
                                    <!-- 简介 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            <span>*</span>
                                            简介
                                        </label>
                                        <div class="middle_form_text">
                                            <textarea name="summary" id="" placeholder="请填写简历" class="form_text summary"
                                                style="height: 90px" value="<%= intro%>"></textarea>
                                        </div>
                                    </div>
                                    <!-- 内容 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                            <span>*</span>
                                            内容
                                        </label>
                                        <div class="middle_form_text">
                                            <textarea name="content" id="" cols="30" rows="10" class="form_text content"
                                                style="height: 340px" value="<%= content%>" placeholder="请填写内容"></textarea>
                                        </div>
                                    </div>
                                    <!-- 提交保存 -->
                                    <div class="middle_form clearfix">
                                        <label for="" class="middle_form_label">
                                        </label>
                                        <div class="middle_form_text">
                                            <span type="submit" class="middle_form_text_btn middle_btn"
                                                data-id="<%= id%>">提交保存</span>
                                        </div>
                                    </div>
                                </form>
                            </section>
                        </div>
                    </div>
                    <!-- 版权 -->
                    <footer>
                        2020 © by 织蝶云系统 ·
                        <a href="javascript:;">织蝶云手册</a>
                        ·
                        <a href="javascript:;">翌羽信息科技(上海)有限公司 版权所有</a>
                    </footer>
                </div>
            </div>
        </div>
    </div>



    <!-- 引入jquery -->
    <script src="./lib/jquery/jquery.min.js"></script>
    <!-- 引入bootstrap的js -->
    <script src="./lib/bootstrap_4/js/bootstrap.min.js"></script>
    <!-- 模板样式js -->
    <script src="./js/lyj_knowledge.js"></script>
    <!-- 引入模板 -->
    <script src="./lib/template/template.js"></script>
    <!-- 引入字体图标js -->
    <script src="./js/iconfont/lyd_approval/iconfont.js"></script>
    <script src="./js/iconfont/lyj_iconfont/iconfont.js"></script>


    <script>
        $('.middle_form_text_btn').on('click', function () {
            let Data = $('.form_text').serialize();
            let userId = $(this).attr('data-id');
            // console.log(userId);
            if ($('.form_text label').val() == '') {
                alert('请选择分类');
                return;
            } else if ($('.form_text title').val() == '') {
                alert('请填写标题');
                return;
            } else if ($('.form_text tag').val() == '') {
                alert('请填写标题');
                return;
            } else if ($('.form_text url').val() == '') {
                alert('请输入URL地址');
                return;
            } else if ($('.form_text summary').val() == '') {
                alert('请填写简历');
                return;
            } else if ($('.form_text content').val() == '') {
                alert('请填写内容');
                return;
            } else if($('.form_text label').val() != '' && $('.form_text title').val() != '' && $('.form_text tag').val() != '' && $('.form_text url').val() != '' && $('.form_text summary').val() != '' && $('.form_text content').val() != ''){
                $.ajax({
                    type: 'post',
                    url: '/userUpdate',
                    data: Data + '&id=' + userId,
                    beforeSend: function () {
                        let flag = confirm('您确定要修改吗？');
                        if (!flag) {
                            return false;
                        }
                    },
                    success: function (result) {
                        // console.log(data);
                        if (result.code == '1002') {
                            alert(result.message);
                            location.href = '/lyj_knowledge_show'
                        }
                    }
                })
            }
        })

    </script>
</body>

</html>